1. Field of the Invention
The present invention is related to a flash memory, and more particularly, to a method for writing data into flash memory and associated memory device and flash memory.
2. Description of the Prior Art
Flash memory can be electrically erased and programmed for data storage. It is widely applied in memory cards, solid-state drives, portable multimedia players, etc. As the flash memory is a non-volatile memory, no power is needed to maintain the information stored in the flash memory. In addition, the flash memory provides fast read access and better shock resistance. These characteristics explain the popularity of the flash memory.
The flash memories may be categorized into NOR-type flash memories and NAND-type flash memories. Regarding the NAND flash memory, it has reduced erasing and programming time and requires less chip area per cell, thus allowing greater storage density and lower cost per bit than the NOR flash memory. In general, the flash memory stores data in an array of memory cells made from floating-gate transistors. Each memory cell can store one bit of information or more than one bit of information by adequately controlling the number of electrical charge on its floating gate to configure the threshold voltage required for turning on the memory cell made of a floating-gate transistor. In this way, when one or more predetermined control gate voltages are applied to a control gate of the floating-gate transistor, the conductive status of the floating-gate transistor would indicate the binary digit(s) stored by the floating-gate transistor.
An In-System Programming code, so called ISP code hereinafter, is generally stored in one page of a first block of the flash memory, and the ISP code is arranged to store some basic information such like the name of brand, the type of flash memory (for example Single-Level Cell (SLC), Multiple-Level Cell (MLC) or Triple-Level Cell (TLC)), etc. The flash memory controller reads the ISP code first to acquire the needed information then executes operations like reading or writing to the flash memory.
However, in the process of packaging of flash memory, especially for TLC flash memory, the ISP code stored in the flash memory may be changed because the threshold voltage distribution of memory cells of flash memory cells changed due to the temperature or other factors, therefore using original control gate voltage setting (i.e., threshold voltage setting) to read the stored bits from the memory cell may fail to obtain the correct stored information due to the changed threshold voltage distribution. In this way, the flash memory controller may not be able to read the ISP code correctly then causes the flash memory can't be used to perform following access operations.